﻿@using Novagoal.Website.Models.Views
@using Novagoal.Website.WebApp.Helpers
@using Novagoal.Utils
@using Ids.Web.Security

@model GamesViewModel
@{
    ViewBag.Title = "Novagoal | Close Game";
    Layout = "~/Views/Shared/MasterLayout.cshtml";
}
@section PageContent {
    <script src="@Url.Content("~/Scripts/novagoal-games.js")" type="text/javascript"></script>
    <div class="main-content ui-corner-top">
        <div class="ui-widget-header ui-corner-all">
            <div class="title">Close Game</div>
        </div>
        @{Html.RenderPartial("SubmitResults"); }
        <div class="ui-widget-content ui-corner-bottom">
            @using (Html.BeginForm("Close", "Games", FormMethod.Post, new { id = "CloseGameForm" }))
            {
                <input type="hidden" id='GameId' name='GameId' value='@Model.Game.Id' />
                <fieldset class='formContent'>
                <legend>Game Information</legend>
                    <div style="text-align:center">
                        @Html.TeamSpan(Model.Game.TeamA)
                        @Html.TextBox("TeamA", "0", new { style = "width:20px" })
                        <span> vs </span>
                        @Html.TextBox("TeamB", "0", new { style = "width:20px" })
                        @Html.TeamSpan(Model.Game.TeamB)
                        <br />
                        <br />
                        <span>Most Valuable Player: </span>
                        <a id="MvpName-@Model.Game.Id" href="javascript:OpenMVPSelection(@Model.Game.Id)">Click here to choose</a>
                        <input id="MvpId-@Model.Game.Id" name="Mvp" type="hidden" value="" />
                    </div>
                </fieldset>
                <br />
                <fieldset id="ClosePreviewFieldset" style="display:none"><legend>Close Preview</legend><div id="ClosePreview"></div></fieldset>
                <div style='text-align:center'>
                    <input type="button" value="Preview" class='button' onclick="javascript:ShowClosePreview()" />
                    <input type="submit" value="Save" class='button' />
                </div>
            }
        </div>
    </div>
}
